/*
 * Module NAME:    tcs_const.h
 * PROJECT CODE:   
 * DESCRIPTION:    TCS BIN Types
 * MAINTAINER:     David Airlie
 * DATE:           22 Feb 2001
 *
 * SOURCE CONTROL: $Id: tcs_const.h,v 1.1.1.1 2007/12/18 05:32:34 tianwq Exp $
 *
 * LICENSE:
 *     This source code is copyright (c) 2001 Parthus Technologies, Ltd.
 *     All rights reserved.
 *
 * REVISION HISTORY:
 *         22-02-01 : Initial Import
 * 
 */
#ifndef PRH_TCS_TYPES_H
#define PRH_TCS_TYPES_H

#include "host_config.h"

#if (PRH_TCS_TERMINAL || PRH_TCS_GATEWAY)


#define PRH_TCS_MAX_CALLS_PER_DEVICE 3


/* Protocol Discriminator - TCS 7.2 - p488 */

#define PRH_TCS_PROTO_DISC_CC 0x00 
#define PRH_TCS_PROTO_DISC_GM 0x20
#define PRH_TCS_PROTO_DISC_CL 0x40


/* Message Type - TCS 7.3 - p488/9 */

/* CALL CONTROL */

/* Call Establishment */
#define PRH_TCS_MSG_ALERTING        (0x00 | PRH_TCS_PROTO_DISC_CC)
#define PRH_TCS_MSG_CALL_PROCEEDING (0x01 | PRH_TCS_PROTO_DISC_CC)
#define PRH_TCS_MSG_CONNECT         (0x02 | PRH_TCS_PROTO_DISC_CC)
#define PRH_TCS_MSG_CONNECT_ACK     (0x03 | PRH_TCS_PROTO_DISC_CC)
#define PRH_TCS_MSG_PROGRESS        (0x04 | PRH_TCS_PROTO_DISC_CC)
#define PRH_TCS_MSG_SETUP           (0x05 | PRH_TCS_PROTO_DISC_CC)
#define PRH_TCS_MSG_SETUP_ACK       (0x06 | PRH_TCS_PROTO_DISC_CC)

/* Call Clearing */
#define PRH_TCS_MSG_DISCONNECT      (0x07 | PRH_TCS_PROTO_DISC_CC)
#define PRH_TCS_MSG_RELEASE         (0x08 | PRH_TCS_PROTO_DISC_CC)
#define PRH_TCS_MSG_RELEASE_COMPLETE (0x09 | PRH_TCS_PROTO_DISC_CC)

/* Misc */
#define PRH_TCS_MSG_INFORMATION     (0x0A | PRH_TCS_PROTO_DISC_CC)
#define PRH_TCS_MSG_START_DTMF      (0x10 | PRH_TCS_PROTO_DISC_CC)
#define PRH_TCS_MSG_START_DTMF_ACK  (0x11 | PRH_TCS_PROTO_DISC_CC)
#define PRH_TCS_MSG_START_DTMF_REJ  (0x12 | PRH_TCS_PROTO_DISC_CC)
#define PRH_TCS_MSG_STOP_DTMF       (0x13 | PRH_TCS_PROTO_DISC_CC)
#define PRH_TCS_MSG_STOP_DTMF_ACK   (0x14 | PRH_TCS_PROTO_DISC_CC)

#define RDA_TCS_MSG_DATA (0x15 | PRH_TCS_PROTO_DISC_CC)

/* GROUP Management Messages */
#define PRH_TCS_MSG_INFO_SUGGEST    0x00
#define PRH_TCS_MSG_INFO_ACCEPT     0x01
#define PRH_TCS_MSG_LISTEN_REQ      0x02
#define PRH_TCS_MSG_LISTEN_ACCEPT   0x03
#define PRH_TCS_MSG_LISTEN_SUGGEST  0x04
#define PRH_TCS_MSG_LISTEN_REJECT      0x05
#define PRH_TCS_MSG_ACCESS_RIGHTS_REQ 0x06
#define PRH_TCS_MSG_ACCESS_RIGHTS_ACCEPT 0x07
#define PRH_TCS_MSG_ACCESS_RIGHTS_REJECT 0x08


/* CL Messages */
#define PRH_TCS_MSG_CL_INFO (0x00 | PRH_TCS_PROTO_DISC_CL)

/* Info Elements */
/* Single Octet */
#define PRH_TCS_IE_SO_SENDING_COMPLETE 0xA1

/* Double Octet */
#define PRH_TCS_IE_DO_CALL_CLASS 0xC0
#define PRH_TCS_IE_DO_CAUSE      0xC1
#define PRH_TCS_IE_DO_PROGRESS_INDICATOR 0xC2
#define PRH_TCS_IE_DO_SIGNAL     0xC3
#define PRH_TCS_IE_DO_KEYPAD_FACILITY 0xC4
#define PRH_TCS_IE_DO_SCO_HANDLE 0xC5

/* Variable Length */
#define PRH_TCS_IE_VL_CLOCK_OFFSET 0x00
#define PRH_TCS_IE_VL_CONFIG_DATA  0x01
#define PRH_TCS_IE_VL_BEARER_CAP   0x02
#define PRH_TCS_IE_VL_DEST_CID     0x03
#define PRH_TCS_IE_VL_CALLING_PARTY_NUM 0x04
#define PRH_TCS_IE_VL_CALLED_PARTY_NUM 0x05
#define PRH_TCS_IE_VL_AUDIO_CONTROL 0x06
#define PRH_TCS_IE_VL_COMPANY_SPECIFIC 0x07

/* Audio Control IE  - TCS 7.4.2 */
#define PRH_TCS_AUDIO_VOL_INC 0x00
#define PRH_TCS_AUDIO_VOL_DEC 0x01
#define PRH_TCS_AUDIO_MIC_GAIN_INC 0x02
#define PRH_TCS_AUDIO_MIC_GAIN_DEC 0x03

/* Bearer Cap - TCS 7.4.3 */
#define PRH_TCS_BEARER_CAP_LINK_TYPE_SCO 0x00
#define PRH_TCS_BEARER_CAP_LINK_TYPE_ACL 0x01
#define PRH_TCS_BEARER_CAP_LINK_TYPE_NONE 0x02

#define PRH_TCS_BEARER_CAP_SCO_PTYPE_HV1 0x05
#define PRH_TCS_BEARER_CAP_SCO_PTYPE_HV2 0x06
#define PRH_TCS_BEARER_CAP_SCO_PTYPE_HV3 0x07
#define PRH_TCS_BEARER_CAP_SCO_PTYPE_DV  0x08

#define PRH_TCS_BEARER_CAP_SCO_CTYPE_CVSD 0x20
#define PRH_TCS_BEARER_CAP_SCO_CTYPE_PCM_ALAW 0x40
#define PRH_TCS_BEARER_CAP_SCO_CTYPE_PCM_ULAW 0x60

#define PRH_TCS_BEARER_CAP_ACL_RFCOMM_OVER_L2CAP 0x00
#define PRH_TCS_BEARER_CAP_ACL_PROTO_PPP 0x10
#define PRH_TCS_BEARER_CAP_ACL_PROTO_IP 0x20

/* Call Class - TCS 7.4.4 */
#define PRH_TCS_CALL_CLASS_EXTERNAL 0x00
#define PRH_TCS_CALL_CLASS_INTERCOM 0x01
#define PRH_TCS_CALL_CLASS_SERVICE 0x02
#define PRH_TCS_CALL_CLASS_EMERGENCY 0x03

/* Called + Calling Party Number - TCS 7.4.5/6 */
#define PRH_TCS_NUM_TYPE_UNKNOWN 0x00
#define PRH_TCS_NUM_TYPE_INTERNATIONAL 0x10
#define PRH_TCS_NUM_TYPE_NATIONAL 0x20
#define PRH_TCS_NUM_TYPE_NETWORK_SPECIFIC 0x30
#define PRH_TCS_NUM_TYPE_SUBSCRIBER 0x40
#define PRH_TCS_NUM_TYPE_ABBREVIATED 0x60
#define PRH_TCS_NUM_TYPE_RESERVED 0x70

#define PRH_TCS_NUM_PLAN_ID_UNKNOWN 0x00
#define PRH_TCS_NUM_PLAN_ID_E164 0x01
#define PRH_TCS_NUM_PLAN_ID_X121 0x03
#define PRH_TCS_NUM_PLAN_ID_RESV 0x04
#define PRH_TCS_NUM_PLAN_ID_NATIONAL 0x08
#define PRH_TCS_NUM_PLAN_ID_PRIVATE 0x09

#define PRH_TCS_CALLING_PRESENTATION_ALLOWED 0x00
#define PRH_TCS_CALLING_PRESENTATION_RESTRICTED 0x20
#define PRH_TCS_CALLING_PRESENTATION_UNAVAIL 0x40
#define PRH_TCS_CALLING_PRESENTATION_RESERVED 0x60

#define PRH_TCS_CALLING_SCREENED_USER_NOT 0x00
#define PRH_TCS_CALLING_SCREENED_USER_PASSED 0x01
#define PRH_TCS_CALLING_SCREENED_USER_FAILED 0x02
#define PRH_TCS_CALLING_SCREENED_NETWORK 0x03

/* Cause - TCS 7.4.7 */
/* FROM ITU 2.2.5 Q850 */
#define PRH_TCS_CAUSE_UNASSIGNEDNUMBER			0x01
#define PRH_TCS_CAUSE_NORMALCALLCLEARING        0x10
#define PRH_TCS_CAUSE_USERBUSY					0x11
#define PRH_TCS_CAUSE_NOUSERRESPONSE			0x12
#define PRH_TCS_CAUSE_NOANSWERFROMUSER			0x13
#define PRH_TCS_CAUSE_SUBSCRIBERABSENT			0x14
#define PRH_TCS_CAUSE_CALLREJECTEDBYUSER	0x15
#define PRH_TCS_CAUSE_NONSELECTEDUSERCLEARING	0x1A
#define PRH_TCS_CAUSE_INVALIDORINCOMPLETENUMBER	0x1C
#define PRH_TCS_CAUSE_NOCHANNELAVAILABLE        0x22
#define PRH_TCS_CAUSE_TEMPORARYFAILURE          0x29
#define PRH_TCS_CAUSE_REQUESTEDCHANNELUNAVAILABLE  0x2C
#define PRH_TCS_CAUSE_BEARERCAPNOTAVAILABLE     0x3A
#define PRH_TCS_CAUSE_BEARERCAPNOTIMPLEMENTED   0x41
#define PRH_TCS_CAUSE_FACILITYNOTIMPLEMENTED    0x45
#define PRH_TCS_CAUSE_RECOVERYONTIMEREXPIRY		0x66

/* Company Specific */
#define PRH_TCS_COMPANY_SPEC_ERICSSON 0x00
#define PRH_TCS_COMPANY_SPEC_NOKIA 0x01
#define PRH_TCS_COMPANY_SPEC_INTEL 0x02
#define PRH_TCS_COMPANY_SPEC_IBM 0x03
#define PRH_TCS_COMPANY_SPEC_TOSHIBA 0x04

/* Signal - TCS 7.4.16 */
#define PRH_TCS_SIGNAL_EXTERNAL 0x40
#define PRH_TCS_SIGNAL_INTERNAL 0x41
#define PRH_TCS_SIGNAL_CALLBACK 0x42


/* Progress Indicator */
#define PRH_TCS_PROGRESSINDICATOR_INBANDINFOAVAILABLE 0x08

/* TIMER VALUES *//* values in 10th's of seconds*/
#define PRH_TCS_TIMER_T301 3*600
#define PRH_TCS_TIMER_T302 150
#define PRH_TCS_TIMER_T303 200
#define PRH_TCS_TIMER_T304 300
#define PRH_TCS_TIMER_T305 300
#define PRH_TCS_TIMER_T308  40
#define PRH_TCS_TIMER_T310 1200 /* Min:30 , Max:120 */
#define PRH_TCS_TIMER_T313  40
#define PRH_TCS_TIMER_T401  80
#define PRH_TCS_TIMER_T402  80
#define PRH_TCS_TIMER_T403  40
#define PRH_TCS_TIMER_T404  25
#define PRH_TCS_TIMER_T405  20
#define PRH_TCS_TIMER_T406 200
#define PRH_TCS_TIMER_BCASTSETUPREPEAT 20
#define PRH_TCS_TIMER_BCASTKEEPCALLINSTANCE 40

/* BT Character SET */
#define PRH_TCS_CHARSET_DIALLING_PAUSE 0x05
#define PRH_TCS_CHARSET_REGISTER_RECALL 0x16


#define PRH_TCS_CC_MSG_SIZE_HEADER             1
#define PRH_TCS_CC_MSG_MASK                    0x1F

/* Information Element Sizes */
#define PRH_TCS_IE_VL_SIZE_HEADER              2

#define PRH_TCS_IE_SIZE_CALLCLASS              2
#define PRH_TCS_IE_SIZE_SENDINGCOMPLETE        1
#define PRH_TCS_IE_BASESIZE_BEARERCAPABILITY   1
#define PRH_TCS_IE_SIZE_CAUSE                  2
#define PRH_TCS_IE_SIZE_PROGRESSINDICATOR      2
#define PRH_TCS_IE_SIZE_SIGNAL                 2
#define PRH_TCS_IE_SIZE_KEYPADFACILITY         2
#define PRH_TCS_IE_BASESIZE_CALLINGPARTYNUMBER 2
#define PRH_TCS_IE_BASESIZE_CALLEDPARTYNUMBER  1

#define PRH_TCS_IE_SIZE_SCOHANDLE              2
#define PRH_TCS_IE_SIZE_DESTCID                4
#define PRH_TCS_IE_BASESIZE_COMPANYSPECIFIC    2

#define PRH_TCS_IE_SIZE_SCOBEARERCAPABILITY    1
#define PRH_TCS_IE_SIZE_ACLBEARERCAPABILITY    23



#define PRH_TCS_PSM_TCSBIN		0x05
#define PRH_TCS_PSM_TCSCORDLESS 0x07


#endif /*(PRH_TCS_TERMINAL || PRH_TCS_GATEWAY)*/


#endif
